<?php
namespace app\admin\model;

use think\Model;

class RegionCity extends BaseModel
{
    public function getSelectOption(array $where, $fields = 'id, name')
    {
        $data = $this
            ->field($fields)
            ->where($where)
            ->select()
            ->toArray();

        $selectOption = [];
        foreach ($data as $option) {
            $selectOption[intval($option['id'])] = $option['name'];
        }
        return $selectOption;
    }
}

?>
